import request from '@/utils/request'
let baseUrl =
  process.env.NODE_ENV === 'production' ? 'api/core' : 'http://172.16.0.14:8020'

export const getSubjects = (data: any) =>
  request({
    baseURL: baseUrl,
    url: '/accounting/subject/query',
    method: 'post',
    data
  })

export const addSubject = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/accounting/subject/add',
    method: 'post',
    data
  })

export const getSubject = (data: number) =>
  request({
    baseURL: baseUrl,
    url: '/accounting/subject/' + data,
    method: 'get'
  })

export const updateSubject = (data?: any) =>
  request({
    baseURL: baseUrl,
    url: '/accounting/subject/update',
    method: 'post',
    data
  })
